import http from '@/utils/http'


// 地址列表
export const getAddressListAPI=(userid:any) =>{
  return http.get('/api/address/list',{
    params:{
      userid
    }
  })
}
// /添加地址

export const addAddressAPI=(data:any) =>{
  const {userid,name,tel,province,city,county,addressDetail,isDefault}=data;
  return http.post('/api/address/add',{
    userid,name,tel,province,city,county,addressDetail,isDefault
  })
}




// 删除地址
export const deleteAddressAPI=(addressid:any) =>{
  return http.post('/api/address/delete',{
    addressid
  })
}

//更新地址
export const updateAddressAPI=(data:any) =>{
  const {addressid,userid,name,tel,province,city,county,addressDetail,isDefault}=data;
  return http.post('/api/address/update',{
    addressid,userid,name,tel,province,city,county,addressDetail,isDefault
  })
}

